<?php

isset($_GET['datatype'])? $datatype = $_GET['datatype'] : $datatype = '1012';


isset($_GET['begindate'])? $begindate = $_GET['begindate'] : $begindate = '1012';

isset($_GET['enddate'])? $enddate = $_GET['enddate'] : $enddate = '1012';

switch ($datatype) {
    // 电压
    case '1001':
        {
            echo json_encode("{\"status\":\"1\",\"msg\":\"ok\",\"count\":\"4\",\"data\":[{\"id\":1,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"meterid\":\"123456123456\",\"recordtime\":\"1501483292000\",\"va\":0.00,\"vb\":220.90,\"vc\":220.90},{\"id\":2,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"meterid\":\"123456123456\",\"recordtime\":\"1501483292000\",\"va\":0.00,\"vb\":220.90,\"vc\":220.90},{\"id\":3,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"meterid\":\"123456123456\",\"recordtime\":\"1502327567000\",\"va\":0.00,\"vb\":359.80,\"vc\":359.80},{\"id\":4,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"meterid\":\"123456123456\",\"recordtime\":\"1502328467000\",\"va\":0.00,\"vb\":359.80,\"vc\":359.80}]}");
        };break;
    // 电流
    case '1002':
        {
            echo json_encode("{\"status\":\"1\",\"msg\":\"ok\",\"count\":\"2\",\"data\":[{\"id\":1,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"meterid\":\"123456123456\",\"recordtime\":\"1502327567000\",\"ia\":0.00,\"ib\":0.00,\"ic\":0.00,\"io\":0.0},{\"id\":2,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"meterid\":\"123456123456\",\"recordtime\":\"1502328467000\",\"ia\":0.00,\"ib\":0.00,\"ic\":0.00,\"io\":0.0}]}");
        };break;
    // 电量
    case '1003':
        {
            echo json_encode("{\"status\":\"1\",\"msg\":\"ok\",\"count\":\"39\",\"data\":[{\"id\":3,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504583100000\"},{\"id\":4,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504584000000\"},{\"id\":5,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504584900000\"},{\"id\":6,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504586700000\"},{\"id\":7,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504595700000\"},{\"id\":8,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504596600000\"},{\"id\":9,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504597500000\"},{\"id\":10,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504861200000\"},{\"id\":26,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505097000000\"},{\"id\":27,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505097900000\"},{\"id\":125,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505181600000\"},{\"id\":126,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505183400000\"},{\"id\":127,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505184300000\"},{\"id\":128,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505185200000\"},{\"id\":129,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505186100000\"},{\"id\":130,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505187000000\"},{\"id\":131,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505441700000\"},{\"id\":132,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505442600000\",\"aqaccvalue\":0.00},{\"id\":133,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505444400000\",\"aqaccvalue\":0.00},{\"id\":134,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505445300000\",\"aqaccvalue\":-310000.00},{\"id\":135,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505446200000\",\"aqaccvalue\":-130000.00},{\"id\":136,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505447100000\",\"aqaccvalue\":-190000.00},{\"id\":137,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505448000000\",\"aqaccvalue\":0.00},{\"id\":138,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505448900000\",\"aqaccvalue\":-250000.00},{\"id\":139,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505449800000\",\"aqaccvalue\":-130000.00},{\"id\":140,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505456100000\",\"aqaccvalue\":0.00},{\"id\":141,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505457000000\",\"aqaccvalue\":0.00},{\"id\":142,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505457900000\",\"aqaccvalue\":810000.00},{\"id\":143,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505458800000\",\"aqaccvalue\":-250000.00},{\"id\":144,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505459700000\",\"aqaccvalue\":-250000.00},{\"id\":145,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505460600000\",\"aqaccvalue\":-250000.00},{\"id\":146,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505461500000\",\"aqaccvalue\":-130000.00},{\"id\":147,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505462400000\",\"aqaccvalue\":750000.00},{\"id\":148,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505463300000\",\"aqaccvalue\":-430000.00},{\"id\":149,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505464200000\",\"aqaccvalue\":-190000.00},{\"id\":150,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505465100000\",\"aqaccvalue\":-130000.00},{\"id\":151,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505466000000\",\"aqaccvalue\":630000.00},{\"id\":152,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505466900000\",\"aqaccvalue\":-250000.00},{\"id\":153,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505467800000\",\"aqaccvalue\":-130000.00}]}");
        };break; 
    // 功率因素
    case '1004':
        {
            echo json_encode("{\"status\":\"1\",\"msg\":\"ok\",\"count\":\"39\",\"data\":[{\"id\":1,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504583100000\",\"powerfactoro\":0.46},{\"id\":2,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504584000000\",\"powerfactoro\":0.47},{\"id\":3,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504584900000\",\"powerfactoro\":0.47},{\"id\":4,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504586700000\",\"powerfactoro\":0.45},{\"id\":5,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504595700000\",\"powerfactoro\":0.47},{\"id\":6,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504596600000\",\"powerfactoro\":0.47},{\"id\":7,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504597500000\",\"powerfactoro\":0.46},{\"id\":8,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504861200000\",\"powerfactoro\":0.47},{\"id\":24,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505097000000\",\"powerfactoro\":0.47},{\"id\":25,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505097900000\",\"powerfactoro\":0.47},{\"id\":123,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505181600000\",\"powerfactoro\":0.48},{\"id\":124,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505183400000\",\"powerfactoro\":0.49},{\"id\":125,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505184300000\",\"powerfactoro\":0.48},{\"id\":126,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505185200000\",\"powerfactoro\":0.49},{\"id\":127,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505186100000\",\"powerfactoro\":0.40},{\"id\":128,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505187000000\",\"powerfactoro\":0.48},{\"id\":129,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505187900000\",\"powerfactoro\":0.48},{\"id\":130,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505442600000\",\"powerfactoro\":0.47},{\"id\":131,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505444400000\",\"powerfactoro\":0.47},{\"id\":132,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505445300000\",\"powerfactoro\":0.47},{\"id\":133,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505446200000\",\"powerfactoro\":0.47},{\"id\":134,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505447100000\",\"powerfactoro\":0.46},{\"id\":135,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505448000000\",\"powerfactoro\":0.47},{\"id\":136,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505448900000\",\"powerfactoro\":0.46},{\"id\":137,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505449800000\",\"powerfactoro\":0.47},{\"id\":138,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505456100000\",\"powerfactoro\":0.47},{\"id\":139,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505457000000\",\"powerfactoro\":0.47},{\"id\":140,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505457900000\",\"powerfactoro\":0.47},{\"id\":141,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505458800000\",\"powerfactoro\":0.47},{\"id\":142,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505459700000\",\"powerfactoro\":0.47},{\"id\":143,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505460600000\",\"powerfactoro\":0.46},{\"id\":144,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505461500000\",\"powerfactoro\":0.46},{\"id\":145,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505462400000\",\"powerfactoro\":0.46},{\"id\":146,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505463300000\",\"powerfactoro\":0.46},{\"id\":147,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505464200000\",\"powerfactoro\":0.47},{\"id\":148,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505465100000\",\"powerfactoro\":0.46},{\"id\":149,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505466000000\",\"powerfactoro\":0.46},{\"id\":150,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505466900000\",\"powerfactoro\":0.46},{\"id\":151,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505467800000\",\"powerfactoro\":0.46}]}");
        };break;
    //有功功率
        case '1005':
            {
                echo json_encode("{\"status\":\"1\",\"msg\":\"ok\",\"count\":\"39\",\"data\":[{\"id\":1,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504583100000\",\"activepowero\":19.00},{\"id\":2,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504584000000\",\"activepowero\":20.00},{\"id\":3,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504584900000\",\"activepowero\":19.00},{\"id\":4,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504586700000\",\"activepowero\":19.00},{\"id\":5,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504595700000\",\"activepowero\":19.00},{\"id\":6,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504596600000\",\"activepowero\":20.00},{\"id\":7,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504597500000\",\"activepowero\":19.00},{\"id\":8,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504861200000\",\"activepowero\":19.00},{\"id\":24,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505097000000\",\"activepowero\":18.00},{\"id\":25,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505097900000\",\"activepowero\":19.00},{\"id\":123,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505181600000\",\"activepowero\":19.00},{\"id\":124,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505183400000\",\"activepowero\":19.00},{\"id\":125,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505184300000\",\"activepowero\":18.00},{\"id\":126,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505185200000\",\"activepowero\":19.00},{\"id\":127,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505186100000\",\"activepowero\":19.00},{\"id\":128,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505187000000\",\"activepowero\":19.00},{\"id\":129,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505187900000\",\"activepowero\":19.00},{\"id\":130,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505442600000\",\"activepowero\":19.00},{\"id\":131,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505444400000\",\"activepowero\":19.00},{\"id\":132,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505445300000\",\"activepowero\":19.00},{\"id\":133,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505446200000\",\"activepowero\":19.00},{\"id\":134,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505447100000\",\"activepowero\":19.00},{\"id\":135,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505448000000\",\"activepowero\":19.00},{\"id\":136,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505448900000\",\"activepowero\":19.00},{\"id\":137,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505449800000\",\"activepowero\":19.00},{\"id\":138,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505456100000\",\"activepowero\":20.00},{\"id\":139,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505457000000\",\"activepowero\":19.00},{\"id\":140,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505457900000\",\"activepowero\":19.00},{\"id\":141,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505458800000\",\"activepowero\":19.00},{\"id\":142,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505459700000\",\"activepowero\":19.00},{\"id\":143,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505460600000\",\"activepowero\":19.00},{\"id\":144,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505461500000\",\"activepowero\":20.00},{\"id\":145,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505462400000\",\"activepowero\":19.00},{\"id\":146,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505463300000\",\"activepowero\":19.00},{\"id\":147,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505464200000\",\"activepowero\":19.00},{\"id\":148,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505465100000\",\"activepowero\":19.00},{\"id\":149,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505466000000\",\"activepowero\":19.00},{\"id\":150,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505466900000\",\"activepowero\":19.00},{\"id\":151,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505467800000\",\"activepowero\":19.00}]}");
            };break;
    //有功功率
        case '1006':
            {
                echo json_encode("{\"status\":\"1\",\"msg\":\"ok\",\"count\":\"39\",\"data\":[{\"id\":1,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504583100000\",\"reactivepowero\":-1.00},{\"id\":2,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504584000000\",\"reactivepowero\":-1.00},{\"id\":3,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504584900000\",\"reactivepowero\":-1.00},{\"id\":4,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504586700000\",\"reactivepowero\":-1.00},{\"id\":5,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504595700000\",\"reactivepowero\":-1.00},{\"id\":6,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504596600000\",\"reactivepowero\":-1.00},{\"id\":7,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504597500000\",\"reactivepowero\":-1.00},{\"id\":8,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1504861200000\",\"reactivepowero\":-1.00},{\"id\":24,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505097000000\",\"reactivepowero\":-1.00},{\"id\":25,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505097900000\",\"reactivepowero\":-1.00},{\"id\":123,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505181600000\",\"reactivepowero\":-1.00},{\"id\":124,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505183400000\",\"reactivepowero\":-1.00},{\"id\":125,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505184300000\",\"reactivepowero\":-1.00},{\"id\":126,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505185200000\",\"reactivepowero\":-1.00},{\"id\":127,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505186100000\",\"reactivepowero\":-1.00},{\"id\":128,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505187000000\",\"reactivepowero\":-1.00},{\"id\":129,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505187900000\",\"reactivepowero\":-1.00},{\"id\":130,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505442600000\",\"reactivepowero\":-1.00},{\"id\":131,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505444400000\",\"reactivepowero\":-1.00},{\"id\":132,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505445300000\",\"reactivepowero\":-1.00},{\"id\":133,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505446200000\",\"reactivepowero\":-1.00},{\"id\":134,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505447100000\",\"reactivepowero\":-1.00},{\"id\":135,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505448000000\",\"reactivepowero\":-1.00},{\"id\":136,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505448900000\",\"reactivepowero\":-1.00},{\"id\":137,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505449800000\",\"reactivepowero\":-1.00},{\"id\":138,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505456100000\",\"reactivepowero\":-1.00},{\"id\":139,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505457000000\",\"reactivepowero\":-1.00},{\"id\":140,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505457900000\",\"reactivepowero\":-1.00},{\"id\":141,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505458800000\",\"reactivepowero\":-1.00},{\"id\":142,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505459700000\",\"reactivepowero\":-1.00},{\"id\":143,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505460600000\",\"reactivepowero\":-1.00},{\"id\":144,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505461500000\",\"reactivepowero\":-1.00},{\"id\":145,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505462400000\",\"reactivepowero\":-1.00},{\"id\":146,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505463300000\",\"reactivepowero\":-1.00},{\"id\":147,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505464200000\",\"reactivepowero\":-1.00},{\"id\":148,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505465100000\",\"reactivepowero\":-1.00},{\"id\":149,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505466000000\",\"reactivepowero\":-1.00},{\"id\":150,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505466900000\",\"reactivepowero\":-1.00},{\"id\":151,\"repeaterid\":\"1\",\"portid\":\"2\",\"meterid\":\"001234561234\",\"recordtime\":\"1505467800000\",\"reactivepowero\":-1.00}]}");
            };break;
    // 电流电压不平衡
    case '1007':
        {
            echo json_encode("{\"status\":\"1\",\"msg\":\"ok\",\"count\":\"39\",\"data\":[{\"id\":3,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1504583100000\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":4,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1504584000000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":5,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1504584900000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":6,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1504586700000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":7,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1504595700000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":8,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1504596600000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":9,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1504597500000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":10,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1504861200000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":26,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1505097000000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":27,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1505097900000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":125,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1505181600000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":126,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1505183400000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":127,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1505184300000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":128,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1505185200000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":129,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1505186100000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":130,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1505187000000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":131,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1505187900000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":132,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1505442600000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":133,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1505444400000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":134,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1505445300000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":135,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1505446200000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":136,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1505447100000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":137,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1505448000000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":138,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1505448900000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":139,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1505449800000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":140,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1505456100000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":141,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1505457000000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":142,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1505457900000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":143,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1505458800000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":144,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1505459700000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":145,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1505460600000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":146,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1505461500000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":147,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1505462400000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":148,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1505463300000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":149,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1505464200000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":150,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1505465100000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":151,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1505466000000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":152,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1505466900000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00},{\"id\":153,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1505467800000\",\"ammeterid\":\"001234561234\",\"meterid\":\"001234561234\",\"vu\":0.00,\"iu\":0.00}]}");
        };break;
    // 电流电压不平衡
    case '1007':
        {
            echo json_encode("{\"status\":\"1\",\"msg\":\"ok\",\"count\":\"2\",\"data\":[{\"id\":1,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1502327567000\",\"meterid\":\"123456123456\",\"vu\":0.00,\"iu\":0.00},{\"id\":2,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"recordtime\":\"1502328467000\",\"meterid\":\"123456123456\",\"vu\":0.00,\"iu\":0.00}]}");
        };break;
    // 谐波电流
    case '1008':
        echo json_encode("{\"status\":\"1\",\"msg\":\"ok\",\"count\":\"2\",\"data\":[{\"id\":1,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"meterid\":\"123456123456\",\"recordtime\":\"1502327567000\",\"harnum\":2,\"ia\":0.65,\"ib\":0.54,\"ic\":0.35},{\"id\":19,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"meterid\":\"123456123456\",\"recordtime\":\"1502328467000\",\"harnum\":2,\"ia\":0.40,\"ib\":0.98,\"ic\":0.05}]}"); break;
    // 谐波电压
    case '1009':
        echo json_encode("{\"status\":\"1\",\"msg\":\"ok\",\"count\":\"2\",\"data\":[{\"id\":1,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"meterid\":\"123456123456\",\"recordtime\":\"1502327567000\",\"harnum\":2,\"va\":0.65,\"vb\":0.54,\"vc\":0.350},{\"id\":19,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"meterid\":\"123456123456\",\"recordtime\":\"1502328467000\",\"harnum\":2,\"va\":0.40,\"vb\":1,\"vc\":0.250}]}");break;
    // 谐波电流含有率
    case '1010':
        echo json_encode("{\"status\":\"1\",\"msg\":\"ok\",\"count\":\"2\",\"data\":[{\"id\":1,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"meterid\":\"123456123456\",\"recordtime\":\"1502327567000\",\"harnum\":2,\"ia\":0.65,\"ib\":0.54,\"ic\":0.35},{\"id\":19,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"meterid\":\"123456123456\",\"recordtime\":\"1502328467000\",\"harnum\":2,\"ia\":0.40,\"ib\":0.98,\"ic\":0.05}]}");break;
    // 谐波电压含有率
    case '1011':
        echo json_encode("{\"status\":\"1\",\"msg\":\"ok\",\"count\":\"2\",\"data\":[{\"id\":1,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"meterid\":\"123456123456\",\"recordtime\":\"1502327567000\",\"harnum\":2,\"va\":0.65,\"vb\":0.54,\"vc\":0.35},{\"id\":19,\"repeaterid\":\"1\",\"portid\":\"2\",\"terminalid\":\"1\",\"meterid\":\"123456123456\",\"recordtime\":\"1502328467000\",\"harnum\":2,\"va\":0.40,\"vb\":0.98,\"vc\":0.05}]}");break;
    // 复费率电量
    case '1012': {
        $dateArry = getEveryDate($begindate, $enddate);
        $data = [
            'jian' => [],
            'feng' => [],
            'ping' => [],
            'gu' => [],
            'date' => $dateArry 
        ];
        for($i=0 ;$i<count($dateArry); $i++){
            array_push($data['jian'], rand(60, 100));
            array_push($data['feng'], rand(60, 100));
            array_push($data['ping'], rand(60, 100));
            array_push($data['gu'], rand(60, 100));
        }
        echo json_encode( json_encode($data) );
    }break;
}

function getEveryDate($date1, $date2){
    $j=0;
    $ThisDate = array();
    for($i = strtotime($date1); $i <= strtotime($date2); $i += 86400) 
    {
        array_push($ThisDate, date("Y-m-d",$i));

    }
    return $ThisDate;
}
$url = 'http://192.168.14.7:8733/DSMService/GetCurver?times=2&meterID=123456123456&begindate=2017/7/19&enddate=2017/9/19&datatype=1011'


?>
